/* Source in Java for processInput()... */ /* (c) Copyright 1996 by Software Research, Inc. */ void processInput(String input) { String restaurant; if (input.equalsIgnoreCase("end")) { return; } acceptingInput = false; try { switch (Integer.parseInt(input)) { case 1: restaurant = "Fog City Diner 1300 Battery 555-2000"; break; case 2: restaurant = "Hunan Village Restaurant 839 Kearney 555-7868"; break; case 3: restaurant = "Ocean Restaurant 726 Clement 555-3351"; break; case 4: restaurant = "Yet Wah 1829 Clement 555-8056"; break; case 5: restaurant = "Einers Danish Restaurant 1901 Clement 555-9860"; break; case 6: restaurant = "Chateau Suzanne 1449 Lombard 555-9326"; break; case 7: restaurant = "Grifone Ristorante 1609 Powell 555-8458"; break; case 8: restaurant = "Flints Barbeque 4450 Shattuck, Oakland"; break; default: restaurant = error; break; } output.setContents(restaurant); } catch (NumberFormatException e) { output.setContents(error); } instructions.setContents(continueInstructions); }